/**
 * Created by 鹏 on 14-3-11.
 */

exports.installFilter = function (req, res, next) {
    var url = req.originalUrl;
    var config = req.app.get("SysConfig");
    //没安装 跳转到安装页面
    if (!config.Install && url != "/Install" && url != "/RunInstall") {
        res.redirect("/Install");
    }
    else {
        next();
    }
}

exports.signInFilter = function (req, res, next) {
    if (req.session.User == null) {
        res.redirect("/");
    }
    else {
        res.locals.User = req.session.User;
        next();
    }
}
